package com.ticket.sass.admin.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ticket.sass.common.entity.tenant.PriceSchemeEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ywb
 * @since 2024-03-06
 */
public interface PriceSchemeMapper extends BaseMapper<PriceSchemeEntity> {
        
        @Select("""
            SELECT
                *
            FROM
                price_schemes
            LEFT JOIN
                price_scheme_rules
            ON
                price_schemes.id = price_scheme_rules.price_scheme_id
            ${ew.customSqlSegment}
        """)
        IPage<PriceSchemeEntity> queryPage(
            Page<PriceSchemeEntity> page,
            @Param(Constants.WRAPPER) QueryWrapper<PriceSchemeEntity> queryWrapper
        );

}
